package com.git.hui.yinshua.api.model.banner;

import lombok.Getter;

/**
 * @author YiHui
 * @date 2024/6/17
 */
public enum BannerTabEnum {
    /**
     * 首页
     */
    HOME(0, "首页横幅"),

    /**
     * 客服
     */
    CUSTOMER_SERVICE(1, "客服配置"),

    /**
     * 商品类目
     */
    CATEGORY(2, "商品分类"),

    /**
     * 商品详情
     */
    GOODS_DETAIL(3, "商品详情"),
    ;

    @Getter
    private Integer tab;

    @Getter
    private String name;

    BannerTabEnum(Integer tab, String name) {
        this.tab = tab;
        this.name = name;
    }

    public static BannerTabEnum tabOf(Integer tab) {
        for (BannerTabEnum t : values()) {
            if (t.getTab().equals(tab)) {
                return t;
            }
        }
        return null;
    }
}
